<?PHP // setup.php

session_start();
require_once("config.php");
require_once("functions.php");
require_once("functions_ui.php");
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); 
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); 
header( "Cache-Control: no-cache, must-revalidate" ); 
header( "Pragma: no-cache" );

if (! isset($_SESSION['USERNAME'])) $_SESSION['USERNAME'] = "";
if (! isset($_SESSION['PASSWORD'])) $_SESSION['PASSWORD'] = "";

if ( isset($_POST['username']) and isset($_POST['password']) ) {
    $_SESSION['USERNAME'] = $_POST['username'];
    $_SESSION['PASSWORD'] = $_POST['password'];
}

require_once("lang/lang.php");

if (! ($_SESSION['USERNAME'] and $_SESSION['PASSWORD'])) {
    require("login.php");
    exit;
}

// Setup the mserv command for the current user.
$MSERVCMD = $mservcmd." -u ".escapeshellarg($_SESSION['USERNAME'])." -p ".escapeshellarg($_SESSION['PASSWORD'])." -h ".$host." ";

// Check login and password
$res = top();
if($res["STATUS"] != "234") {
   require("logout.php");
   exit;
}

$connected = true;



?>

